package com.ruoyi.system.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.annotation.Excel.ColumnType;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 数据库配置表 sys_db_config
 * 
 * @author ruoyi
 */
public class SysDbConfig extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 数据库ID */
    @Excel(name = "数据库ID", cellType = ColumnType.NUMERIC)
    private Long dbId;

    /** 数据库名称 */
    @Excel(name = "数据库名称")
    private String dbName;

    /** 数据库类型 */
    @Excel(name = "数据库类型")
    private String dbType;

    /** 连接地址 */
    @Excel(name = "连接地址")
    private String dbUrl;

    /** 驱动类 */
    @Excel(name = "驱动类")
    private String dbDriver;

    /** 用户名 */
    @Excel(name = "用户名")
    private String dbUsername;

    /** 密码 */
    @Excel(name = "密码")
    private String dbPassword;

    /** 状态（0正常 1停用） */
    @Excel(name = "状态", readConverterExp = "0=正常,1=停用")
    private String status;

    public Long getDbId()
    {
        return dbId;
    }

    public void setDbId(Long dbId)
    {
        this.dbId = dbId;
    }

    @NotBlank(message = "数据库名称不能为空")
    @Size(min = 0, max = 100, message = "数据库名称不能超过100个字符")
    public String getDbName()
    {
        return dbName;
    }

    public void setDbName(String dbName)
    {
        this.dbName = dbName;
    }

    @NotBlank(message = "数据库类型不能为空")
    @Size(min = 0, max = 20, message = "数据库类型不能超过20个字符")
    public String getDbType()
    {
        return dbType;
    }

    public void setDbType(String dbType)
    {
        this.dbType = dbType;
    }

    @NotBlank(message = "连接地址不能为空")
    @Size(min = 0, max = 500, message = "连接地址不能超过500个字符")
    public String getDbUrl()
    {
        return dbUrl;
    }

    public void setDbUrl(String dbUrl)
    {
        this.dbUrl = dbUrl;
    }

    @NotBlank(message = "驱动类不能为空")
    @Size(min = 0, max = 100, message = "驱动类不能超过100个字符")
    public String getDbDriver()
    {
        return dbDriver;
    }

    public void setDbDriver(String dbDriver)
    {
        this.dbDriver = dbDriver;
    }

    @NotBlank(message = "用户名不能为空")
    @Size(min = 0, max = 100, message = "用户名不能超过100个字符")
    public String getDbUsername()
    {
        return dbUsername;
    }

    public void setDbUsername(String dbUsername)
    {
        this.dbUsername = dbUsername;
    }

    @NotBlank(message = "密码不能为空")
    @Size(min = 0, max = 100, message = "密码不能超过100个字符")
    public String getDbPassword()
    {
        return dbPassword;
    }

    public void setDbPassword(String dbPassword)
    {
        this.dbPassword = dbPassword;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("dbId", getDbId())
            .append("dbName", getDbName())
            .append("dbType", getDbType())
            .append("dbUrl", getDbUrl())
            .append("dbDriver", getDbDriver())
            .append("dbUsername", getDbUsername())
            .append("dbPassword", getDbPassword())
            .append("status", getStatus())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .toString();
    }
} 